home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / a_utils / perl / perl5a1.lha / perl5alpha1 / do / tell < prev    next >
Encoding:
Text File  |  1992-08-15  |  406 b   |  28 lines

  1. long
  2. do_tell(stab)
  3. STAB *stab;
  4. {
  5.     register STIO *stio;
  6.  
  7.     if (!stab)
  8.     goto phooey;
  9.  
  10.     stio = stab_io(stab);
  11.     if (!stio || !stio->ifp)
  12.     goto phooey;
  13.  
  14. #ifdef ULTRIX_STDIO_BOTCH
  15.     if (feof(stio->ifp))
  16.     (void)fseek (stio->ifp, 0L, 2);        /* ultrix 1.2 workaround */
  17. #endif
  18.  
  19.     return ftell(stio->ifp);
  20.  
  21. phooey:
  22.     if (dowarn)
  23.     warn("tell() on unopened file");
  24.     errno = EBADF;
  25.     return -1L;
  26. }
  27.  
  28.